package com.atguigu.day11.Test04;

public class CompareColor implements CompareAble{
    public Apple compare(Apple a,Apple b){
         System.out.println("挑红的：");
        if ("红色".equals(a.getColor())) {
            System.out.println(a.getSize()+"-"+a.getColor());
            return a;
        }
        else if ("红色".equals(b.getColor())) {
            System.out.println(b.getSize()+"-"+b.getColor());
            return b;
        }
        else
            return null;
//        System.out.println("挑红的：");
//        if("红色".equals(a.getColor())){
//            System.out.println(a);
//        }
//        if("红色".equals(b.getColor())){
//            System.out.println(b);
//        }
    }
}
